﻿@{
    ViewData["Title"] = "Home Page";
}

<h1>第一种</h1>
@Html.TextBox("code", "", new { @class = "textBox yzCode", placeholder = "验证码", id = "loginCode", onblur = "validateLoginCode(loginCode);" })
<img src="/Home/GetValidateCode" alt="验证码" id="loginCodeImga" />

<hr />
<h1>第二种</h1>
<img src="../Home/GetValidateCode" alt="验证码" id="loginCodeImg" />

<hr />
<h1>第三种</h1>
<img src="/Home/GetAuthCode" alt="验证码" id="loginCodeImg3">



<script src="~/lib/jquery/dist/jquery.js"></script>
<script type="text/javascript">
    $("#loginCodeImg").click(function () {
        this.src = "../Home/GetValidateCode?time=" + (new Date()).getTime();
    });

    $("#loginCodeImga").click(function () {
        this.src = "../Home/GetValidateCode?time=" + (new Date()).getTime();
    });

    $("#loginCodeImg3").click(function () {
        this.src = "../Home/GetAuthCode?time=" + (new Date()).getTime();
    });
</script>

